//
//  XDHeader.h
//  HengHuaSupervision
//
//  Created by XD-XY on 3/20/14.
//  Copyright (c) 2014 XD-XY. All rights reserved.
//  所有宏的集合

#import "XDHeader_Img.h"
#import "XDHeader_Color.h"
#import "XDHeader_Url.h"
#import "XDHeader_Coord.h"
#import "XDHeader_TextFont.h"


#pragma mark - Debug log macro
#ifdef DEBUG

#define DDLOG(...) NSLog(__VA_ARGS__)
#define DDLOG_CURRENT_METHOD NSLog(@"%@-%@", NSStringFromClass([self class]), NSStringFromSelector(_cmd))

#else

#define DDLOG(...) ;
#define DDLOG_CURRENT_METHOD ;

#endif

//keychain的key
#define KEY_IN_KEYCHAIN     @"com.henghua"
#define  KEY_UDID           @"com.udid"


/*********
 宏作用:单例生成宏
 使用方法:http://blog.csdn.net/totogo2010/article/details/8373642
 **********/
#define DEFINE_SINGLETON_FOR_HEADER(className) \
\
+ (className *)shared##className;

#define DEFINE_SINGLETON_FOR_CLASS(className) \
\
+ (className *)shared##className { \
static className *shared##className = nil; \
static dispatch_once_t onceToken; \
dispatch_once(&onceToken, ^{ \
shared##className = [[self alloc] init]; \
}); \
return shared##className; \
}

//判断是否是ios7系统
#define IOS7                           [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.f

//判断是否是iphone5的设备
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

//算 宽加X坐标的和
#define width_x(view)  view.frame.size.width + view.frame.origin.x

//算 高加Y坐标的和
#define height_y(view)  view.frame.size.height + view.frame.origin.y

//字符串不为空
#define IS_NOT_EMPTY(string) (string !=nil && [string isKindOfClass:[NSString class]] && ![string isEqualToString:@""])

//数组不为空
#define ARRAY_IS_NOT_EMPTY(array) (array && [array isKindOfClass:[NSArray class]] && [array count])

//标签版本号
#define mTagsCurrentTime @"tagsCurrentTime"
//资产信息版本号
#define mPropertyCurrentTime @"propertyCurrentTime"
//资产标签关联版本号
#define mPropertyWithLabelCurrentTime @"propertyWithLabelCurrentTime"
//扫描记录版本号
#define mScanCurrentTime    @"scanCurrentTime"
//贴标签版本号
#define mSupervisionCurrentTime @"supervisionCurrentTime"

